import java.util.Scanner;
import java.util.Arrays;
public class DemoTest {
    public static int sum(int num){
        if(num<=9){
            return num;
        }else{
            return num%10+sum(num/10);
        }
    }
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        System.out.println(sum(num));
    }

    public static int fib1(int n){
        if(n==1||n==2){
            return 1;
        }
        else{
            return fib(n-1)+fib(n-2);
        }
    }
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println(fib(n));
    }

    public static void main3(String[] args) {
        int [] array = {10,90,30,80,40};
        int [] array2 = new int[]{30,40,59,68};
        int [] array3 = new int[10];
        array3 = new int[]{2,3,4,6,5,3,4};
        int i = 0;
        for(i = 0;i<array.length;i++){
            System.out.print(array[i]+" ");
        }
        System.out.println(" ");
        for(i = 0;i<array2.length;i++){
            System.out.print(array2[i]+" ");
        }
        System.out.println(" ");
        for(i = 0;i<array3.length;i++){
            System.out.print(array3[i]+" ");
        }
    }

    public static void main4(String[] args) {
        int [] array = {11,22,33,44};
        for(int i : array){
            System.out.print(i);
        }
    }

    public static void main5(String[] args) {
        int [] array = {11,22,33,44};
        System.out.println(array);
    }

    public static void print(int[] array){
        System.out.print("[");
        for(int i:array){
            System.out.print(i);
            if(i!=array.length){
                System.out.print(",");
            }
        }
        System.out.print("]");
    }

    public static void main6(String[] args) {
        int [] array= { 1,2,3,4};
        print(array);
    }

    public static void copy(int[] array2,int[]array){
        int i = 0;
        for( i = 0;i<array2.length;i++){
            array2[i] = array[i];
        }
        array2[i] = 100;//为了区分
    }

    public static void main7(String[] args) {
        int[] array = {1,2,3,4,5,6};
        int[] array2 = new int[array.length];
        int i = 0;
        for( i = 0;i<array2.length;i++){
            array2[i] = array[i];
        }
        array2[i] = 100;//为了区分
        String str1 = Arrays.toString(array);
        String str2 = Arrays.toString(array2);
        System.out.println(str1);
        System.out.println(str2);
    }

    public static void main8(String[] args) {
        int[] array = {1,2,3,4,5,6};
        int[] copy = Arrays.copyOf(array,array.length);
        String str = Arrays.toString(copy);
        System.out.println(str);
    }

    public static void main9(String[] args) {
        int[] array = {1,2,3,4,5,6};
        int[] copy = new int[array.length];
        System.arraycopy(array,0,copy,0,array.length);
                //src 你要拷贝到数组  ，srcPos 开始拷贝的下标
                //dest 目的数组     ， destPos 目的数组的位置
                //length你要拷贝的长度
        System.out.println(Arrays.toString(copy));
    }

    public static void main10(String[] args) {
        int[] array = {1,2,3,4,5,6};
        int[] copy = array.clone();
        System.out.println(Arrays.toString(copy));
    }
    public static int Num(int num1,int num2){
        return (num1>num2)?num1:num2;
    }
    public static double Num(double num1,double num2){
        return (num1>num2)?num2:num1;
    }
    public static void Num(double num1,double num2,int num3){
        double max = (num1>num2)?num1:num2;
        if(num3>max){
            System.out.println(num3+">"+((num1>num2)?num1:num2)+">"+((num1>num2)?num2:num1));
        }else if(max>num3){
            if(num3<((num1>num2)?num2:num1)){
                System.out.println(max+">"+((num1>num2)?num2:num1)+">"+num3);
            }else{
                System.out.println(max+">"+num3+">"+((num1>num2)?num2:num1));

            }
        }
    }
    public static void main(String[] args) {
        int i = 11;
        int k = 20;
        double num1 = 10.0;
        double num2 = 20.0;
        Num(num1,num2,i);
    }


    public static int fib(int n){
        if(n==1||n==2){
            return 1;
        }else{
            return fib(n-1)+fib(n-2);
        }
    }
    public static void main12(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println(fib(n));
    }
    public static int Add2(int num){
        if(num<9) {
            return num;
        } else{
            return num%10+Add2(num/10);
        }
    }
    public static void main13(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        System.out.println(Add2(num));
    }

    public static void show(int num){
        if(num<9) {
            System.out.println(num);
            return;
        }
            else{
                show(num/10);
                System.out.println(num%10);
            }

    }
    public static void main14(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        show(num);
    }

    public static int DadD(int n){
        if(n==0){
            return n;
        }else{
            return DadD(n-1)+n;
        }
    }
    public static void main15(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println(DadD(n));
    }
    public static int Jcheng(int n){
        int i = 0;
        int tem = 1;
        for(i = 1;i<=n;i++){
            tem*=i;
        }
        return tem;
    }
    public static void main16(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println(Jcheng(n));
    }
}
